﻿namespace EyeOpen.Data
{
	using System.Collections.Generic;
	using System.Data.Entity;

	public abstract class DbPopulator<TDbContext>
	{
		public abstract void Populate(TDbContext dbContext);

		protected IEnumerable<TEntity> AddToRepository<TEntity>(IDbSet<TEntity> repository, IEnumerable<TEntity> entityList)
			where TEntity : class
		{
			foreach (var e in entityList)
			{
				repository.Add(e);
			}

			return entityList;
		}
	}
}